<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
</script>
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/drug/drugPriceAdjustRecord/index')">药品调价记录表列表</a>
                </li>

            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                            	<form:form id="searchForm" modelAttribute="drugPriceAdjustRecord"  onsubmit="return loadDivForm('mainCenterDiv','searchFormDict','${ctx}/drug/drugPriceAdjustRecord/index');" method="post" class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                    &nbsp;&nbsp;<label>药品名称 ：</label><form:input path="drugName" htmlEscape="false" maxlength="50" class="form-control" />
                                    &nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                </form:form>
                            </div>
                        </div>
                        <table id="contentTable" class="table table-bordered table-striped mg-t datatable">
                            <thead>
                                <tr>
                                        <th rowspan="2">药品名称</th>
                                        <th rowspan="2">药品规格</th>
                                        <th rowspan="2">大包装库存量</th>
                                        <th rowspan="2">供应商</th>
                                        <th rowspan="2">调价时间</th>

                                    <th colspan="2" style="border-left: 1px solid #e3e6f3">批发价/元</th>
                                    <th colspan="2">零售价/元</th>

                                </tr>
                            <tr>
                                <th style="border-left: 1px solid #e3e6f3">盘盈</th>
                                <th>盘亏</th>
                                <th>盘盈</th>
                                <th>盘亏</th>

                            </tr>

                            </thead>
                            <tbody>
                            <c:forEach items="${page.list}" var="drugPriceAdjustRecord">
                                <tr >
                                        <td> ${drugPriceAdjustRecord.drugName}</td>
                                        <td> ${drugPriceAdjustRecord.drugSpec}</td>
                                        <td> ${drugPriceAdjustRecord.quantity}</td>
                                        <td> ${drugPriceAdjustRecord.firmName}</td>
                                        <td><fmt:formatDate value="${drugPriceAdjustRecord.changeDate}" pattern="yyyy-MM-dd  HH:mm:ss"></fmt:formatDate> </td>


                                        <td <c:if test="${drugPriceAdjustRecord.tradeDifferentPrice>0}"> style="color: darkgreen;font-weight: bold" </c:if>> <c:if test="${drugPriceAdjustRecord.tradeDifferentPrice>0}">${drugPriceAdjustRecord.tradeDifferentPrice*drugPriceAdjustRecord.quantity}</c:if></td>
                                        <td <c:if test="${drugPriceAdjustRecord.tradeDifferentPrice<0}"> style="color: darkred;font-weight: bold" </c:if>> <c:if test="${drugPriceAdjustRecord.tradeDifferentPrice<0}">${drugPriceAdjustRecord.tradeDifferentPrice*drugPriceAdjustRecord.quantity}</c:if></td>
                                        <td <c:if test="${drugPriceAdjustRecord.retailDifferentPrice>0}"> style="color: darkgreen;font-weight: bold" </c:if>> <c:if test="${drugPriceAdjustRecord.retailDifferentPrice>0}">${drugPriceAdjustRecord.retailDifferentPrice*drugPriceAdjustRecord.quantity}</c:if></td>
                                        <td <c:if test="${drugPriceAdjustRecord.retailDifferentPrice<0}"> style="color: darkred;font-weight: bold" </c:if>> <c:if test="${drugPriceAdjustRecord.retailDifferentPrice<0}">${drugPriceAdjustRecord.retailDifferentPrice*drugPriceAdjustRecord.quantity}</c:if></td>



                                </tr>
                            </c:forEach>

                        </table>
                        <div class="pagination">${page}</div>
                    </div>
                </div>
            </section>
        </div>
    </div>